using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VLIEFKO
    {
        public void SetUpNewRow(ref DataRow dwReturn)
        {

            switch (app.company)
            {
                case "YGR":
                case "YCC":
                case "TST":
                default:
                    #region=========
                    dwReturn["LSKMANDANT"] = app.Mandant;
                    dwReturn["LSKLIEFNR"] = "00000000";
                    dwReturn["LSKKONDSL"] = "STD ";
                    dwReturn["LSKLIEFBED"] = "   ";
                    dwReturn["LSKLANDU"] = "   ";
                    dwReturn["LSKPLZU"] = "            ";
                    dwReturn["LSKORTU"] = "                                        ";
                    dwReturn["LSKCOUNTYU"] = "    ";
                    dwReturn["LSKCITY"] = "    ";
                    dwReturn["LSKSPEDSL"] = "   ";
                    dwReturn["LSKVERSART"] = "T  ";
                    dwReturn["LSKZAHLBED"] = "   ";
                    dwReturn["LSKEKON"] = "    ";
                    dwReturn["LSKVALUTA"] = "000";
                    dwReturn["LSKSWKZ"] = " ";
                    dwReturn["LSKVERPFRE"] = "0";
                    dwReturn["LSKFRAFRE"] = "0";
                    dwReturn["LSKFRAEIG"] = "0";
                    dwReturn["LSKVERSFRE"] = "0";
                    dwReturn["LSKVERSEIG"] = "0";
                    dwReturn["LSKZOLLFRE"] = "0";
                    dwReturn["LSKZOLLEIG"] = "0";
                    dwReturn["LSKARTGR"] = " ";
                    dwReturn["LSKPREISLST"] = "     ";
                    dwReturn["LSKMWSTGR"] = "  ";
                    dwReturn["LSKSONDERSTA"] = " ";
                    dwReturn["LSKRABART1"] = "   ";
                    dwReturn["LSKRABPROZ1"] = "0";
                    dwReturn["LSKRABART2"] = "   ";
                    dwReturn["LSKRABPROZ2"] = "0";
                    dwReturn["LSKRABART3"] = "   ";
                    dwReturn["LSKRABPROZ3"] = "0";
                    dwReturn["LSKRABART4"] = "   ";
                    dwReturn["LSKRABPROZ4"] = "0";
                    dwReturn["LSKRABART5"] = "   ";
                    dwReturn["LSKRABPROZ5"] = "0";
                    dwReturn["LSKRABATTME1"] = "0";
                    dwReturn["LSKRABATTP1"] = "0";
                    dwReturn["LSKRABATTME2"] = "0";
                    dwReturn["LSKRABATTP2"] = "0";
                    dwReturn["LSKRABATTME3"] = "0";
                    dwReturn["LSKRABATTP3"] = "0";
                    dwReturn["LSKRABATTME4"] = "0";
                    dwReturn["LSKRABATTP4"] = "0";
                    dwReturn["LSKRABATTME5"] = "0";
                    dwReturn["LSKRABATTP5"] = "0";
                    dwReturn["LSKRABATTME6"] = "0";
                    dwReturn["LSKRABATTP6"] = "0";
                    dwReturn["LSKBANKBEZ"] = "                                        ";
                    dwReturn["LSKBANKORT"] = "                                        ";
                    dwReturn["LSKBANKLAND"] = "   ";
                    dwReturn["LSKBIC"] = "           ";
                    dwReturn["LSKIBAN"] = "                                  ";
                    dwReturn["LSKBEM"] = "                                        ";
                    dwReturn["LSKTERMTAB"] = "    ";
                    dwReturn["LSKKONDSLAB"] = "    ";
                    dwReturn["LSKBONVON"] = "0";
                    dwReturn["LSKBONIN"] = "0";
                    dwReturn["LSKBONBIS"] = "0";
                    dwReturn["LSKBONLDAT"] = "0";
                    dwReturn["LSKBONWE1"] = "0";
                    dwReturn["LSKBONP1"] = "0";
                    dwReturn["LSKBONWE2"] = "0";
                    dwReturn["LSKBONP2"] = "0";
                    dwReturn["LSKBONWE3"] = "0";
                    dwReturn["LSKBONP3"] = "0";
                    dwReturn["LSKBONWE4"] = "0";
                    dwReturn["LSKBONP4"] = "0";
                    dwReturn["LSKBONWE5"] = "0";
                    dwReturn["LSKBONP5"] = "0";
                    dwReturn["LSKBONWE6"] = "0";
                    dwReturn["LSKBONP6"] = "0";
                    dwReturn["LSKBONWE7"] = "0";
                    dwReturn["LSKBONP7"] = "0";
                    dwReturn["LSKBONWE8"] = "0";
                    dwReturn["LSKBONP8"] = "0";
                    dwReturn["LSKBONWE9"] = "0";
                    dwReturn["LSKBONP9"] = "0";
                    dwReturn["LSKBONWE10"] = "0";
                    dwReturn["LSKBONP10"] = "0";
                    dwReturn["LSKBASIS"] = " ";
                    dwReturn["LSKSPLITT"] = " ";
                    dwReturn["LSKMEEH"] = "   ";
                    dwReturn["LSKRABABRKZ"] = " ";
                    dwReturn["LSKBONABRKZ"] = " ";
                    dwReturn["LSKGBABRKZ"] = " ";
                    dwReturn["LSKGABONP"] = "0";
                    dwReturn["LSKFBABRKZ"] = " ";
                    dwReturn["LSKFIXBONP"] = "0";
                    dwReturn["LSKVBABRKZ"] = " ";
                    dwReturn["LSKVORBONP"] = "0";
                    dwReturn["LSKZUAB1"] = "   ";
                    dwReturn["LSKZUABWE1"] = "0";
                    dwReturn["LSKZUABME1"] = "   ";
                    dwReturn["LSKZUAB2"] = "   ";
                    dwReturn["LSKZUABWE2"] = "0";
                    dwReturn["LSKZUABME2"] = "   ";
                    dwReturn["LSKFILLER"] = "                                                 ";
                    dwReturn["LSKAENZL"] = "0";
                    dwReturn["LSKAENB"] = "        ";
                    dwReturn["LSKAEND"] = "0";
                    dwReturn["LSKNEUB"] = "        ";
                    dwReturn["LSKNEUD"] = "0";
                    #endregion
                    break;
            }
         }

        public void InsertLIEFKO(DataRow dwData, string ITXDBVERSION = "50.24")
        { 
            or1 = OracleDB.CreateCommand();
            dwData["LSKNEUB"] = app.User;
            dwData["LSKNEUD"] = date;
            switch (ITXDBVERSION)
            {
                default:
                case "YGR":
                    or1.CommandText = "INSERT INTO LIEFKO ( LSKMANDANT,LSKLIEFNR,LSKKONDSL,LSKLIEFBED,LSKLANDU,LSKPLZU,LSKORTU,LSKCOUNTYU,LSKCITY,LSKSPEDSL,LSKVERSART,LSKZAHLBED,LSKEKON,LSKVALUTA,LSKSWKZ,LSKVERPFRE,LSKFRAFRE,LSKFRAEIG,LSKVERSFRE,LSKVERSEIG,LSKZOLLFRE,LSKZOLLEIG,LSKARTGR,LSKPREISLST,LSKMWSTGR,LSKSONDERSTA,LSKRABART1,LSKRABPROZ1,LSKRABART2,LSKRABPROZ2,LSKRABART3,LSKRABPROZ3,LSKRABART4,LSKRABPROZ4,LSKRABART5,LSKRABPROZ5,LSKRABATTME1,LSKRABATTP1,LSKRABATTME2,LSKRABATTP2,LSKRABATTME3,LSKRABATTP3,LSKRABATTME4,LSKRABATTP4,LSKRABATTME5,LSKRABATTP5,LSKRABATTME6,LSKRABATTP6,LSKBANKBEZ,LSKBANKORT,LSKBANKLAND,LSKBIC,LSKIBAN,LSKBEM,LSKTERMTAB,LSKKONDSLAB,LSKBONVON,LSKBONIN,LSKBONBIS,LSKBONLDAT,LSKBONWE1,LSKBONP1,LSKBONWE2,LSKBONP2,LSKBONWE3,LSKBONP3,LSKBONWE4,LSKBONP4,LSKBONWE5,LSKBONP5,LSKBONWE6,LSKBONP6,LSKBONWE7,LSKBONP7,LSKBONWE8,LSKBONP8,LSKBONWE9,LSKBONP9,LSKBONWE10,LSKBONP10,LSKBASIS,LSKSPLITT,LSKMEEH,LSKRABABRKZ,LSKBONABRKZ,LSKGBABRKZ,LSKGABONP,LSKFBABRKZ,LSKFIXBONP,LSKVBABRKZ,LSKVORBONP,LSKZUAB1,LSKZUABWE1,LSKZUABME1,LSKZUAB2,LSKZUABWE2,LSKZUABME2,LSKFILLER,LSKAENZL,LSKAENB,LSKAEND,LSKNEUB,LSKNEUD)"
                    + " VALUES (:LSKMANDANT:,:LSKLIEFNR:,:LSKKONDSL:,:LSKLIEFBED:,:LSKLANDU:,:LSKPLZU:,:LSKORTU:,:LSKCOUNTYU:,:LSKCITY:,:LSKSPEDSL:,:LSKVERSART:,:LSKZAHLBED:,:LSKEKON:,:LSKVALUTA:,:LSKSWKZ:,:LSKVERPFRE:,:LSKFRAFRE:,:LSKFRAEIG:,:LSKVERSFRE:,:LSKVERSEIG:,:LSKZOLLFRE:,:LSKZOLLEIG:,:LSKARTGR:,:LSKPREISLST:,:LSKMWSTGR:,:LSKSONDERSTA:,:LSKRABART1:,:LSKRABPROZ1:,:LSKRABART2:,:LSKRABPROZ2:,:LSKRABART3:,:LSKRABPROZ3:,:LSKRABART4:,:LSKRABPROZ4:,:LSKRABART5:,:LSKRABPROZ5:,:LSKRABATTME1:,:LSKRABATTP1:,:LSKRABATTME2:,:LSKRABATTP2:,:LSKRABATTME3:,:LSKRABATTP3:,:LSKRABATTME4:,:LSKRABATTP4:,:LSKRABATTME5:,:LSKRABATTP5:,:LSKRABATTME6:,:LSKRABATTP6:,:LSKBANKBEZ:,:LSKBANKORT:,:LSKBANKLAND:,:LSKBIC:,:LSKIBAN:,:LSKBEM:,:LSKTERMTAB:,:LSKKONDSLAB:,:LSKBONVON:,:LSKBONIN:,:LSKBONBIS:,:LSKBONLDAT:,:LSKBONWE1:,:LSKBONP1:,:LSKBONWE2:,:LSKBONP2:,:LSKBONWE3:,:LSKBONP3:,:LSKBONWE4:,:LSKBONP4:,:LSKBONWE5:,:LSKBONP5:,:LSKBONWE6:,:LSKBONP6:,:LSKBONWE7:,:LSKBONP7:,:LSKBONWE8:,:LSKBONP8:,:LSKBONWE9:,:LSKBONP9:,:LSKBONWE10:,:LSKBONP10:,:LSKBASIS:,:LSKSPLITT:,:LSKMEEH:,:LSKRABABRKZ:,:LSKBONABRKZ:,:LSKGBABRKZ:,:LSKGABONP:,:LSKFBABRKZ:,:LSKFIXBONP:,:LSKVBABRKZ:,:LSKVORBONP:,:LSKZUAB1:,:LSKZUABWE1:,:LSKZUABME1:,:LSKZUAB2:,:LSKZUABWE2:,:LSKZUABME2:,:LSKFILLER:,:LSKAENZL:,:LSKAENB:,:LSKAEND:,:LSKNEUB:,:LSKNEUD:)";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }

            Connect2Proxy(or1);
        }

        public DataSet QueryLIEFKO(DataRow dwData, int option = 1)
        {
            
            or1 = OracleDB.CreateCommand();
            // APZMANDANT  APZART APZVAR APZANRKRS APZALFDNR APZSTUFE
            switch (option)
            {
                case 1:
                    or1.CommandText = "SELECT DISTINCT LSKKONDSL AS KEY,M.* FROM LIEFKO M "
                        + " WHERE LSKMANDANT=:LSKMANDANT: "
                         + dwData["LSKLIEFNR"].ToString()
                        + dwData["LSKKONDSL"].ToString();
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 2:
                    or1.CommandText = "SELECT DISTINCT LSKKONDSL AS KEY,M.* FROM LIEFKO M "
                         + " WHERE LSKMANDANT=:LSKMANDANT: AND LSKLIEFNR=:LSKLIEFNR: AND LSKKONDSL=:LSKKONDSL:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 3:
                    break;
                case 4:
                    break;
                case 5:
                    or1.CommandText = "SELECT DISTINCT LSKKONDSL AS KEY,LF.* FROM EKKOPF FL JOIN LIEFKO LF ON FL.EKKMANDANT=LSKMANDANT AND FL.EKKLIEFNR=LSKLIEFNR"
             + " WHERE EKKMANDANT=:EKKMANDANT: AND EKKAUFKRS=:EKKAUFKRS: AND EKKAUFLFD=:EKKAUFLFD:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    break;
                case 11:
                    or1.CommandText = "SELECT DISTINCT LSKKONDSL AS KEY,M.*,(select STRAGG(DECODE(TXTKATR,'2101',TRIM(SUBSTR(TXTKTEXT,21)))) from txtind t1,txtkon t2 "
                        + " where t1.txtimandant =t2.txtkmandant and t1.txtipind = t2.txtkpind and t1.txtitxtart = 'LSK' AND TXTISIND LIKE M.LSKLIEFNR||M.LSKKONDSL||'%') AS ACCNAME, "
                        + " (select STRAGG(DECODE(TXTKATR,'2103',TRIM(SUBSTR(TXTKTEXT,21)))) from txtind t1,txtkon t2 "
                        + " where t1.txtimandant =t2.txtkmandant and t1.txtipind = t2.txtkpind and t1.txtitxtart = 'LSK' AND TXTISIND LIKE M.LSKLIEFNR||M.LSKKONDSL||'%') AS SWIFTCODE, "
                        + " (select STRAGG(DECODE(TXTKATR,'2104',TRIM(SUBSTR(TXTKTEXT,21)))) from txtind t1,txtkon t2 "
                        + " where t1.txtimandant =t2.txtkmandant and t1.txtipind = t2.txtkpind and t1.txtitxtart = 'LSK' AND TXTISIND LIKE M.LSKLIEFNR||M.LSKKONDSL||'%') AS ACCOUNT, "
                        + " (select STRAGG(DECODE(TXTKATR,'2105',TRIM(SUBSTR(TXTKTEXT,21)))) from txtind t1,txtkon t2 "
                        + " where t1.txtimandant =t2.txtkmandant and t1.txtipind = t2.txtkpind and t1.txtitxtart = 'LSK' AND TXTISIND LIKE M.LSKLIEFNR||M.LSKKONDSL||'%') AS BANK, "
                        + " (select STRAGG(DECODE(TXTKATR,'2107',TRIM(SUBSTR(TXTKTEXT,21)))) from txtind t1,txtkon t2 "
                        + " where t1.txtimandant =t2.txtkmandant and t1.txtipind = t2.txtkpind and t1.txtitxtart = 'LSK' AND TXTISIND LIKE M.LSKLIEFNR||M.LSKKONDSL||'%') AS ADDR  "
                        + " FROM LIEFKO M "
                        + " WHERE LSKMANDANT=:LSKMANDANT: "
                         + dwData["LSKLIEFNR"].ToString()
                        + dwData["LSKKONDSL"].ToString();
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 12:
                    or1.CommandText = "SELECT DISTINCT LSKKONDSL AS KEY,M.*,L.*,(select STRAGG(DECODE(TXTKATR,'2101',TRIM(SUBSTR(TXTKTEXT,21)))) from txtind t1,txtkon t2 "
                        + " where t1.txtimandant =t2.txtkmandant and t1.txtipind = t2.txtkpind and t1.txtitxtart = 'LSK' AND TXTISIND LIKE M.LSKLIEFNR||M.LSKKONDSL||'%') AS ACCNAME, "
                        + " (select STRAGG(DECODE(TXTKATR,'2103',TRIM(SUBSTR(TXTKTEXT,21)))) from txtind t1,txtkon t2 "
                        + " where t1.txtimandant =t2.txtkmandant and t1.txtipind = t2.txtkpind and t1.txtitxtart = 'LSK' AND TXTISIND LIKE M.LSKLIEFNR||M.LSKKONDSL||'%') AS SWIFTCODE, "
                        + " (select STRAGG(DECODE(TXTKATR,'2104',TRIM(SUBSTR(TXTKTEXT,21)))) from txtind t1,txtkon t2 "
                        + " where t1.txtimandant =t2.txtkmandant and t1.txtipind = t2.txtkpind and t1.txtitxtart = 'LSK' AND TXTISIND LIKE M.LSKLIEFNR||M.LSKKONDSL||'%') AS ACCOUNT, "
                        + " (select STRAGG(DECODE(TXTKATR,'2105',TRIM(SUBSTR(TXTKTEXT,21)))) from txtind t1,txtkon t2 "
                        + " where t1.txtimandant =t2.txtkmandant and t1.txtipind = t2.txtkpind and t1.txtitxtart = 'LSK' AND TXTISIND LIKE M.LSKLIEFNR||M.LSKKONDSL||'%') AS BANK, "
                        + " (select STRAGG(DECODE(TXTKATR,'2107',TRIM(SUBSTR(TXTKTEXT,21)))) from txtind t1,txtkon t2 "
                        + " where t1.txtimandant =t2.txtkmandant and t1.txtipind = t2.txtkpind and t1.txtitxtart = 'LSK' AND TXTISIND LIKE M.LSKLIEFNR||M.LSKKONDSL||'%') AS ADDR  "
                        + " FROM LIEFKO M,LIEFDAT L "
                        + " WHERE M.LSKMANDANT = L.LSMANDANT AND M.LSKLIEFNR = L.LSLIEFNR AND LSKMANDANT=:LSKMANDANT: "
                         + dwData["LSKLIEFNR"].ToString()
                        + dwData["LSKKONDSL"].ToString();
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
            }

            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = "LIEFKO"; 
            return SResult;
        }

        public void DeleteLIEFKO(DataRow dwData, int option = 1)
        {

            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM LIEFKO  "
                         + " WHERE LSKMANDANT=:LSKMANDANT: AND LSKLIEFNR=:LSKLIEFNR: AND LSKKONDSL=:LSKKONDSL:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }

        public void UpdateLIEFKO(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            if (option == 0)
            {
                switch (app.company)
                {
                    default:
                    case "YGR":
                        option = 1;
                        break;
                }
            }
            dwData["LSKAENB"] = app.User;
            dwData["LSKAEND"] = date;
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "UPDATE LIEFKO SET LSKMANDANT=:LSKMANDANT:,LSKLIEFNR=:LSKLIEFNR:,LSKKONDSL=:LSKKONDSL:,LSKLIEFBED=:LSKLIEFBED:,LSKLANDU=:LSKLANDU:,LSKPLZU=:LSKPLZU:,LSKORTU=:LSKORTU:,LSKCOUNTYU=:LSKCOUNTYU:,LSKCITY=:LSKCITY:,LSKSPEDSL=:LSKSPEDSL:,LSKVERSART=:LSKVERSART:,LSKZAHLBED=:LSKZAHLBED:,LSKEKON=:LSKEKON:,LSKVALUTA=:LSKVALUTA:,LSKSWKZ=:LSKSWKZ:,LSKVERPFRE=:LSKVERPFRE:,LSKFRAFRE=:LSKFRAFRE:,LSKFRAEIG=:LSKFRAEIG:,LSKVERSFRE=:LSKVERSFRE:,LSKVERSEIG=:LSKVERSEIG:,LSKZOLLFRE=:LSKZOLLFRE:,LSKZOLLEIG=:LSKZOLLEIG:,LSKARTGR=:LSKARTGR:,LSKPREISLST=:LSKPREISLST:,LSKMWSTGR=:LSKMWSTGR:,LSKSONDERSTA=:LSKSONDERSTA:,LSKRABART1=:LSKRABART1:,LSKRABPROZ1=:LSKRABPROZ1:,LSKRABART2=:LSKRABART2:,LSKRABPROZ2=:LSKRABPROZ2:,LSKRABART3=:LSKRABART3:,LSKRABPROZ3=:LSKRABPROZ3:,LSKRABART4=:LSKRABART4:,LSKRABPROZ4=:LSKRABPROZ4:,LSKRABART5=:LSKRABART5:,LSKRABPROZ5=:LSKRABPROZ5:,LSKRABATTME1=:LSKRABATTME1:,LSKRABATTP1=:LSKRABATTP1:,LSKRABATTME2=:LSKRABATTME2:,LSKRABATTP2=:LSKRABATTP2:,LSKRABATTME3=:LSKRABATTME3:,LSKRABATTP3=:LSKRABATTP3:,LSKRABATTME4=:LSKRABATTME4:,LSKRABATTP4=:LSKRABATTP4:,LSKRABATTME5=:LSKRABATTME5:,LSKRABATTP5=:LSKRABATTP5:,LSKRABATTME6=:LSKRABATTME6:,LSKRABATTP6=:LSKRABATTP6:,LSKBANKBEZ=:LSKBANKBEZ:,LSKBANKORT=:LSKBANKORT:,LSKBANKLAND=:LSKBANKLAND:,LSKBIC=:LSKBIC:,LSKIBAN=:LSKIBAN:,LSKBEM=:LSKBEM:,LSKTERMTAB=:LSKTERMTAB:,LSKKONDSLAB=:LSKKONDSLAB:,LSKBONVON=:LSKBONVON:,LSKBONIN=:LSKBONIN:,LSKBONBIS=:LSKBONBIS:,LSKBONLDAT=:LSKBONLDAT:,LSKBONWE1=:LSKBONWE1:,LSKBONP1=:LSKBONP1:,LSKBONWE2=:LSKBONWE2:,LSKBONP2=:LSKBONP2:,LSKBONWE3=:LSKBONWE3:,LSKBONP3=:LSKBONP3:,LSKBONWE4=:LSKBONWE4:,LSKBONP4=:LSKBONP4:,LSKBONWE5=:LSKBONWE5:,LSKBONP5=:LSKBONP5:,LSKBONWE6=:LSKBONWE6:,LSKBONP6=:LSKBONP6:,LSKBONWE7=:LSKBONWE7:,LSKBONP7=:LSKBONP7:,LSKBONWE8=:LSKBONWE8:,LSKBONP8=:LSKBONP8:,LSKBONWE9=:LSKBONWE9:,LSKBONP9=:LSKBONP9:,LSKBONWE10=:LSKBONWE10:,LSKBONP10=:LSKBONP10:,LSKBASIS=:LSKBASIS:,LSKSPLITT=:LSKSPLITT:,LSKMEEH=:LSKMEEH:,LSKRABABRKZ=:LSKRABABRKZ:,LSKBONABRKZ=:LSKBONABRKZ:,LSKGBABRKZ=:LSKGBABRKZ:,LSKGABONP=:LSKGABONP:,LSKFBABRKZ=:LSKFBABRKZ:,LSKFIXBONP=:LSKFIXBONP:,LSKVBABRKZ=:LSKVBABRKZ:,LSKVORBONP=:LSKVORBONP:,LSKZUAB1=:LSKZUAB1:,LSKZUABWE1=:LSKZUABWE1:,LSKZUABME1=:LSKZUABME1:,LSKZUAB2=:LSKZUAB2:,LSKZUABWE2=:LSKZUABWE2:,LSKZUABME2=:LSKZUABME2:,LSKFILLER=:LSKFILLER:,LSKAENZL=:LSKAENZL:,LSKAENB=:LSKAENB:,LSKAEND=:LSKAEND:,LSKNEUB=:LSKNEUB:,LSKNEUD=:LSKNEUD:"
                    + " WHERE LSKMANDANT=:LSKMANDANT: AND LSKLIEFNR=:LSKLIEFNR: AND LSKKONDSL=:LSKKONDSL:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); 
                    break;
                default:
                    break;
            } 
            Connect2Proxy(or1);
        }
    }
}
